<%@ page import="java.lang.management.ManagementFactory" %>
<%@ page import="java.lang.management.RuntimeMXBean" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%
    //获取JVM的启动时间
    RuntimeMXBean bean = ManagementFactory.getRuntimeMXBean();
    long startTime = bean.getStartTime();
    java.text.SimpleDateFormat formatter = new java.text.SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
    java.util.Date Now = new java.util.Date(startTime);
    String  start_TIME = formatter.format(Now);
    request.setAttribute("startDate",start_TIME);
%>
<html>
<head>
    <title>首页</title>
    <jsp:include page="../../../common/jsp/jqueryResource.jsp"></jsp:include>

    <link rel="stylesheet" href="${basePath}/bootstrap/css/bootstrap-table.min.css">
    <link rel="stylesheet" href="${basePath}/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="${basePath}/bootstrap/css/font-awesome.min.css" >
    <link rel="stylesheet" href="${basePath}/bootstrap/bootstrap-datepicker/bootstrap.css">
    <link rel="stylesheet" href="${basePath}/bootstrap/css/custom.min.css" >
    <link rel="stylesheet" href="${basePath}/bootstrap/css/templatemo-style.css" >
    <link rel="stylesheet" href="${basePath}/bootstrap/css/bootstrapValidator.css" >
    <link rel="stylesheet" href="${basePath}/bootstrap/bootstrap-datepicker/bootstrap-datetimepicker.min.css" >
    <script src="${basePath}/bootstrap/js/bootstrap-table.min.js"></script>
    <script src="${basePath}/bootstrap/js/bootstrap-datetimepicker.js"></script>
    <script src="${basePath}/bootstrap/js/bootstrap-table-zh-CN.min.js"></script>
    <script src="${basePath}/bootstrap/js/bootstrap.min.js"></script>
    <script src="${basePath}/javascript/import/import.js"></script>

</head>
<style>
    #tb_mainFKZK td{
        /*height: 35px;*/
        /*line-height: 35px;*/
    }
    .time-tips {
        text-align: center;
        padding-top:15px;
    }
    .time-tips span{
        display: inline-block;
        font-size: 18px;

    }
    .time_num{
        text-align: center;
        padding-top:8px;
    }
    .time{
        font-size:18px;
        padding: 0 3px;
        font-weight: bold;
        color: #39ADB4;

    }

</style>
<body onload="time_fun()">
<!-- Left column -->
<div class="templatemo-flex-row" style="height: 100%;">
    <div class="templatemo-sidebar">
        <header class="templatemo-site-header">
            <div class="square"></div>
            <h1> 数据平台</h1>
        </header>
        <div class="profile-photo-container">
            <img src="${basePath}/images/profile-photo.jpg" alt="Profile Photo" class="img-responsive">
            <div class="profile-photo-overlay"></div>
        </div>
        <!-- Search box -->
        <form class="templatemo-search-form" role="search">
            <%-- <div class="input-group">
                 <button type="submit" class="fa fa-search"></button>
                 <input type="text" class="form-control" placeholder="Search" name="srch-term" id="srch-term">
             </div>--%>
        </form>
        <div class="mobile-menu-icon">
            <i class="fa fa-bars"></i>
        </div>
        <nav class="templatemo-left-nav" id="navbar-nav">
            <ul>
                <li><a href="${basePath}main/index.html"><i class="fa fa-home fa-fw"></i>首页</a></li>
                <li><a href="${basePath}ywjcxm.html" ><i class="fa fa-paragraph fa-fw"></i>项目信息管理</a></li>
                <li><a href="${basePath}ycsj/ycsj.html"><i class="fa fa-bug"></i>异常事件统计</a></li>
                <li><a href="${basePath}dxfs.html"><i class="fa fa-fax"></i>短信发送统计</a></li>
                <li><a href="${basePath}admin/index.html"><i class="fa fa-cog"></i>系统后台管理</a></li>
            </ul>
        </nav>
    </div>
    <!-- Main content -->
    <div class="templatemo-content col-1 light-gray-bg">
        <div class="templatemo-top-nav-container">
            <div class="row">
                <div class="col-md-1">
                    <div class="templatemo-top-nav " >
                      <span style="padding-top:15px;display: block;color: #333;">首页</span>
                    </div>
                </div>
                <div class="col-md-9">
                    <div id="times_wrap" class="time_num">
                        运行时间
                        <div class="time_w">
                            <span id="time_d" class="time"> </span >天
                            <span id="time_h" class="time"> </span >时
                            <span id="time_m" class="time"> </span >分
                            <span id="time_s" class="time"> </span >秒
                        </div>
                    </div>
                </div>
                <div class="col-md-2">
                    <nav>
                        <ul class="nav navbar-nav navbar-right">
                            <li class="">
                                <a href="javascript:;" class="user-profile dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
                                    <img src="../images/img.jpg" alt="">欢迎${session_userinfo.displayname}
                                    <span class=" fa fa-angle-down"></span>
                                </a>
                                <ul class="dropdown-menu dropdown-usermenu pull-right">
                                    <li><a href="${basePath}login/index.html"> <h5><i class="fa fa-sign-out pull-right"></i> </h5> <h5>退出系统</h5></a></li>
                                </ul>
                            </li>
                        </ul>
                    </nav>
                </div>
             </div>
        </div>
    </div>
    <footer class="text-right" style="position: fixed;width: 100%;bottom: 0;right: 0;z-index: 9;">
        <p>焊接口-软件科技 版权所有 @Copyright 2018-2027 <a href="" target="_blank" title="上海焊接口有限公司">上海焊接口有限公司</a> </p>
    </footer>
</div>
<script language="JavaScript">

    $(function(){
        show_time();
    });
    function show_time(){
        var time_start = new Date("${startDate}").getTime();//设定开始时间(服务启动时间)
        var time_end = new Date().getTime(); //设定结束时间(等于系统当前时间)
        //计算时间差
        var time_distance = time_end - time_start;
        if(time_distance > 0){
            // 天时分秒换算
            var int_day = Math.floor(time_distance/86400000)
            time_distance -= int_day * 86400000;

            var int_hour = Math.floor(time_distance/3600000)
            time_distance -= int_hour * 3600000;

            var int_minute = Math.floor(time_distance/60000)
            time_distance -= int_minute * 60000;

            var int_second = Math.floor(time_distance/1000)
            // 时分秒为单数时、前面加零
            if(int_day < 10){
                int_day = "0" + int_day;
            }
            if(int_hour < 10){
                int_hour = "0" + int_hour;
            }
            if(int_minute < 10){
                int_minute = "0" + int_minute;
            }
            if(int_second < 10){
                int_second = "0" + int_second;
            }
            // 显示时间
            $("#time_d").html(int_day);
            $("#time_h").html(int_hour);
            $("#time_m").html(int_minute);
            $("#time_s").html(int_second);

            setTimeout("show_time()",1000);

        }else{
            $("#time_d").html('00');
            $("#time_h").html('00');
            $("#time_m").html('00');
            $("#time_s").html('00');

        }
    }
</script>
</body>
</html>